package cn.iocoder.yudao.module.comment.dal.mysql.comment1;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.comment.dal.dataobject.comment1.CommentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.comment.controller.admin.comment1.vo.*;

/**
 * 旅游线路评论 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CommentMapper extends BaseMapperX<CommentDO> {

    default PageResult<CommentDO> selectPage(CommentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CommentDO>()
                .eqIfPresent(CommentDO::getCommentId, reqVO.getCommentId())
                .eqIfPresent(CommentDO::getRouteId, reqVO.getRouteId())
                .eqIfPresent(CommentDO::getUserId, reqVO.getUserId())
                .eqIfPresent(CommentDO::getContent, reqVO.getContent())
                .eqIfPresent(CommentDO::getScore, reqVO.getScore())
                .betweenIfPresent(CommentDO::getCommentTime, reqVO.getCommentTime())
                .eqIfPresent(CommentDO::getIsPositive, reqVO.getIsPositive())
                .betweenIfPresent(CommentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CommentDO::getCommentId));
    }

}